package service.sale.interfaces;

import java.rmi.RemoteException;
import java.util.ArrayList;

import sale.entities.FacturaVO;
import sale.entities.OrderVO;
import sale.entities.SaleVO;
import sale.exceptions.EmptyOrderException;
import sale.exceptions.EmptySaleExcpetion;
import sale.exceptions.NoSalesException;
import service.article.exceptions.ProxyException;
import article.entities.ArticleVO;
import article.exceptions.OutOfStockIngredientsException;

public interface SaleProxyMgt {

	SaleVO[] getOpenTableSales() throws ProxyException, RemoteException,
			NoSalesException;

	SaleVO[] getOpenTakeoOutSales() throws ProxyException, RemoteException,
			NoSalesException;

	SaleVO[] getOpenDeliverySales() throws ProxyException, RemoteException,
			NoSalesException;

	OrderVO[] getOpenOrders() throws ProxyException, RemoteException;

	void newSale(OrderVO ord, int tableKey) throws ProxyException,
			RemoteException, EmptyOrderException,
			OutOfStockIngredientsException;

	void newDelSale(OrderVO ord, String address, String tel, int ci)
			throws ProxyException, RemoteException, EmptyOrderException,
			OutOfStockIngredientsException;

	void newTakeOutSale(OrderVO ord) throws ProxyException, RemoteException,
			EmptyOrderException, OutOfStockIngredientsException;

	void addOrder(OrderVO ord, int tableKey) throws ProxyException,
			RemoteException, EmptySaleExcpetion, OutOfStockIngredientsException;

	void deleteArticles(SaleVO sale, ArrayList<ArticleVO> arts)
			throws ProxyException, RemoteException;

	FacturaVO close(SaleVO sale) throws ProxyException, RemoteException,
			EmptySaleExcpetion;

	void commit(FacturaVO fact) throws ProxyException, RemoteException;

	boolean hasOpenSale(int tableKey) throws ProxyException, RemoteException;

	SaleVO getSale(int tableKey) throws ProxyException, RemoteException;

	int[] getOpenTables() throws ProxyException, RemoteException;
	
	void setRedy(OrderVO ord) throws ProxyException, RemoteException;

	//
	// ArrayList<ArticleVO> getArticles() throws ProxyException,
	// RemoteException;
}
